package com.gallery.dao;


import com.gallery.models.User;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Repository;



public class UserDAO extends JdbcDaoSupport {

    private final String registerUser = "insert into user (login, password, role, name, surname," +
            "about, email) values (?,?,?,?,?,?,?)";

    public void registerNewUser(User user) {
        getJdbcTemplate().update(registerUser, new Object[]{user.getLogin(),
        user.getPassword(), user.getRole(), user.getName(), user.getSurname(),
        user.getAbout(), user.getEmail()});
    }
}
